using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using YayiMgr.Ability.Docking.Commom;
using YayiMgr.Ability.Docking.DentalProceduresApp;
using YayiMgr.Ability.Docking.DentalProceduresApp.Dto;

namespace YayiMgr.Web.Controllers
{
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class DentalProceduresController : ControllerBase
    {        
        public IDentalProceduresServicer DentalProceduresSvr { get; set; }

        [HttpGet]
        public async Task<QueryListDto<DentalProceduresDto>> Get()
        {
            return await DentalProceduresSvr.GatAllDentalProcedures();
        }

        [HttpPost]
        public async Task<QueryListDto<DentalProceduresDto>> Get(DentalProceduresQueryDto dto)
        {
            return await DentalProceduresSvr.GatDentalProcedures(dto);
        }

   
        [HttpGet("{id}")]
        public async Task<ResponseDto<DentalProceduresDto>> Get(Guid id)
        {
            return await DentalProceduresSvr.GetDentalProceduresById(id);
        }


        [HttpPost]
        public async Task<ResponseDto<DentalProceduresDto>> Post(DentalProceduresCreateDto input)
        {
            return await DentalProceduresSvr.AddDentalProcedures(input);
        }


        [HttpPut("{id}")]
        public async Task<ResponseDto<DentalProceduresDto>> Put(Guid id, DentalProceduresUpdateDto input)
        {
            return await DentalProceduresSvr.UpdateDentalProcedures(id,input);
        }


        [HttpDelete("{id}")]
        public async Task<ResponseDto<Object>> Delete(Guid id)
        {
            return await DentalProceduresSvr.DeleteDentalProcedures(id);
        }
    }
}